import {RecordListEntity} from "../src/entity/record.list.entity";
import {UserListEntity} from "../src/entity/user.list.entity";
import {OperateLogEntity} from "../src/entity/operate.log.entity";
import {AppListEntity} from "../src/entity/app.list.entity";

const globalApiPrefix = '/ai-repost';
let redisAddress = '127.0.0.1:6379:';
let databaseName = 'ai-repost'
let mysqlConfig = {
    host: '127.0.0.1',
    port: 3306,
    username: 'root',
    password: '123456',
}
const ApiKeyConfig = {
    tencent: {
        secretId: "AKIDwteCWdXDi292iBSWN7j9MMAl9KZ8rPnz",
        secretKey: "4vY0HLCrRnwsb7PUO5g3C8rOiohRzPgl",
    },
    volces: 'dd6503f2-a3f3-4caf-ae1e-2e90afe98e8a',
    baidu: {
        appId: 'app-HkewDMl7',
        apiKey:'bce-v3/ALTAK-EUw30K9NfAJiIZi68aMfb/8100a0273c22ef88837f984b50fc26ec7bcaad1f'
    },
}
const PlatformConfig = {
    tencent: {code: 'tencent', name: '腾讯'},
    volces: {code: 'volces', name: '火山'},
    baidu: {code: 'baidu', name: '百度'},
}
const ModelList = [
    {
        label: 'DeepSeek-V3',
        code: 'dsv3',
        platform:[
            {
                code: 'tencent',
                label: '腾讯',
                model: 'deepseek-v3',
                price: {
                    in: 0.002,
                    out: 0.008
                },
                platformPrice: {
                    in: 0.001,
                    out: 0.004
                }
            },
            {
                code: 'baidu',
                label: '百度',
                model: 'deepseek-v3',
                price: {
                    in: 0.002,
                    out: 0.008
                },
                platformPrice: {
                    in: 0.001,
                    out: 0.004
                }

            },
            {
                code: 'volces',
                label: '火山',
                model: 'deepseek-v3-241226',
                price: {
                    in: 0.0020,
                    out: 0.0080
                },
                platformPrice: {
                    in: 0.001,
                    out: 0.004
                }
            }
        ]
    },
    {
        label: 'DeepSeek-R1',
        code: 'dsr1',
        platform:[
            {
                code: 'tencent',
                label: '腾讯',
                model: 'deepseek-r1',
                price: {
                    in: 0.004,
                    out: 0.016
                },
                platformPrice: {
                    in: 0.002,
                    out: 0.008
                }
            },
            {
                code: 'baidu',
                label: '百度',
                model: 'deepseek-r1',
                price: {
                    in: 0.004,
                    out: 0.016
                },
                platformPrice: {
                    in: 0.002,
                    out: 0.008
                }
            },
            {
                code: 'volces',
                label: '火山',
                model: 'deepseek-r1-250120',
                price: {
                    in: 0.0020,
                    out: 0.0080
                },
                platformPrice: {
                    in: 0.0010,
                    out: 0.0040
                }
            }
        ]
    }
]
let modelConfig = {
    tencent: {
        'dsv3': {
            label: 'DeepSeek-V3',
            code: 'dsv3',
            model: 'deepseek-v3',
            price: {
                in: 0.002,
                out: 0.008
            },
            platformPrice: {
                in: 0.001,
                out: 0.004
            }
        },
        'dsr1': {
            label: 'DeepSeek-R1',
            code: 'dsr1',
            model: 'deepseek-r1',
            price: {
                in: 0.004,
                out: 0.016
            },
            platformPrice: {
                in: 0.002,
                out: 0.008
            }
        }
    },
    baidu: {
        'dsv3': {
            label: 'DeepSeek-V3',
            code: 'dsv3',
            model: 'deepseek-v3',
            price: {
                in: 0.002,
                out: 0.008
            },
            platformPrice: {
                in: 0.001,
                out: 0.004
            }
        },
        'dsr1': {
            label: 'DeepSeek-R1',
            code: 'dsr1',
            model: 'deepseek-r1',
            price: {
                in: 0.004,
                out: 0.016
            },
            platformPrice: {
                in: 0.002,
                out: 0.008
            }
        }
    },
    volces: {
        'dsv3': {
            label: 'DeepSeek-V3',
            code: 'dsv3',
            model: 'deepseek-v3-241226',
            price: {
                in: 0.0020,
                out: 0.0080
            },
            platformPrice: {
                in: 0.001,
                out: 0.004
            }
        },
        'dsr1': {
            label: 'DeepSeek-R1',
            code: 'dsr1',
            model: 'deepseek-r1-250120',
            price: {
                in: 0.0020,
                out: 0.0080
            },
            platformPrice: {
                in: 0.0010,
                out: 0.0040
            }
        }
    }
}
let env = 'prod'
// let env = 'dev'
if (env === 'dev') {
    mysqlConfig = {
        host: '111.229.239.187',// 腾讯云
        port: 3609,
        username: 'root',
        password: 'huangqinghua@123!@',
    }
    redisAddress = '111.229.239.187:6388:'
}
if (env === 'prod') {
    mysqlConfig = {
        host: '127.0.0.1',
        port: 3609,
        username: 'root',
        password: 'W4>0&9Frt$dfa120)!g4362',
    }
    redisAddress = '127.0.0.1:6388:'
    databaseName = 'ai_repost'
}
export default {
    GlobalApiPrefix: globalApiPrefix,
    ApiHeaderKey: 'api-token', // 用户调用api的headers的key
    ManageHeaderKey: 'manage-token',// 用户后台管理系统headers的key
    AdminHeaderKey: 'admin-token',// 管理员后台管理系统headers的key
    ApiTokenExpireSec: 365*24*60*60,// API token过期时间(秒) 365天
    ManageTokenExpireSec: 30*24*60*60,// 用户后台管理系统 token过期时间(秒) 30天
    AdminTokenExpireSec: 3*60*60,// 管理员后台管理系统 token过期时间(秒) 3小时
    Auth2CodeExpireSec: 10*60,// auth2第三方登录code过期时间(秒) 10分钟
    Auth2AccessTokenExpireSec: 2*60*60,// auth2 accessToken过期时间(秒) 2小时
    Auth2RefreshTokenExpireSec: 30*24*60*60,// auth2 accessToken过期时间(秒) 30天
    ApiTokenSecretKey: 'U2FsdGVkX19t2UKM1z3oUIp8yG8vlX',
    ManageSecretKey: 'rvizRy63IxrqkuDpLD59SlDbOx6Ffq0V',
    AdminSecretKey: 'v8TAiEo90or2eZAloeAqX1dvt7euzqr2',
    Auth2CodeSecretKey: 'U2FsdGVkX19cM5DflO5zQbwut5NvnZ6J',
    Auth2OpenIdSecretKey: 'JvGiCuelNSUkgVbEE6KxC3TSeYmF2Mip',
    Auth2OpenIdAppendStr: 'X19CQZDkZ9O9OBqPdvM5d81na3UncIXV',
    Auth2AccessTokenSecretKey: 'LjvvcufCoK7VZsYFJt6TTyG7LwFuRJ7s',
    Auth2RefreshTokenSecretKey: 'X19HU3pq1yEqU3afv9ziiAiUAuNQi0wI',
    iv: 'd8dc0c00684a6678451f126c3c739c4c',
    Redis: [redisAddress],
    Mysql: {
        ...mysqlConfig,
        database: databaseName,
        entities: [RecordListEntity, UserListEntity, OperateLogEntity, AppListEntity],
        synchronize: true, // 是否自动将实体类同步到数据库
    },
    ApiKeyConfig,
    PlatformConfig,
    ModelConfig: modelConfig,
    ModelList,
    AuthExternal: [
        `${globalApiPrefix}/api/user/login`,
        `${globalApiPrefix}/api/user/create`,
        `${globalApiPrefix}/api/auth/login`,
        `${globalApiPrefix}/open-api/auth/code`,
        `${globalApiPrefix}/open-api/auth/access-token`,
        `${globalApiPrefix}/open-api/auth/model-token`,
        `${globalApiPrefix}/open-api/auth/model-list`,
        `${globalApiPrefix}/open-api/auth/refresh-token`,
    ],
    ManagePathArr: [
        `${globalApiPrefix}/api/user/get`,
        `${globalApiPrefix}/api/user/password-reset`,
        `${globalApiPrefix}/api/user/info-update`,
        `${globalApiPrefix}/api/user/model-list`,
        `${globalApiPrefix}/api/record/query-list`,
        `${globalApiPrefix}/api/auth/get-api-token`,
    ],
    AdminPathArr: [
        `${globalApiPrefix}/api/app/list`,
        `${globalApiPrefix}/api/app/get`,
        `${globalApiPrefix}/api/app/create`,
        `${globalApiPrefix}/api/app/status-update`,
        `${globalApiPrefix}/api/auth/create-api-token`,
        `${globalApiPrefix}/api/auth/get-api-token`,
        `${globalApiPrefix}/api/auth/model-list`,
        `${globalApiPrefix}/api/user/list`,
        `${globalApiPrefix}/api/user/info-update`,
        `${globalApiPrefix}/api/user/password-reset`,
        `${globalApiPrefix}/api/user/status-update`,
        `${globalApiPrefix}/api/user/recharge`,
        `${globalApiPrefix}/api/record/query-list`,
        `${globalApiPrefix}/api/log/list`,
    ],
    ApiPathArr: [
        `${globalApiPrefix}/stream/tencent/chat`,
        `${globalApiPrefix}/stream/volces/chat`,
        `${globalApiPrefix}/stream/baidu/chat`,
    ],

}
